package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 用户机构关联Entity类
 * 
 */
@Entity
@Table(name = "OM_USER_ORG")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class OmUserOrg {

	//属性
	private Long uoId;		//主键ID
	private Long userId;	//用户ID
	private Long orgId;		//机构ID
	private String isMain;	//是否主机构

	
	@Id
    @SequenceGenerator(name="SEQ_OM_USER_ORG", sequenceName="SEQ_OM_USER_ORG", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_OM_USER_ORG")
	public Long getUoId() {
		return uoId;
	}

	public void setUoId(Long uoId) {
		this.uoId = uoId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getOrgId() {
		return orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}

	public String getIsMain() {
		return isMain;
	}

	public void setIsMain(String isMain) {
		this.isMain = isMain;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}